package com.tfy.liquor.bean;

import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 礼包转购物券信息
 */
@Data
public class RolloverRecords {
    private String id; // 编号
    private String userId; // 用户id
    private String giveId; // 赠送id
    private String orderId; // 订单编号
    private Double amount; // 金额
    private Double balance; // 余额
    private String category; // 类别
    private String illustrate; // 说明
    private Date createDate; // 时间
    private String createDates; // 时间
    private String remark; // 备注


    public String getCreateDate() {
        if (null == createDate) {
            return createDates;
        }
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return format.format(createDate);
    }

    @Override
    public String toString() {
        return "RolloverRecords{" +
                "id='" + id + '\'' +
                ", userId='" + userId + '\'' +
                ", giveId='" + giveId + '\'' +
                ", orderId='" + orderId + '\'' +
                ", amount=" + amount +
                ", balance=" + balance +
                ", category='" + category + '\'' +
                ", illustrate='" + illustrate + '\'' +
                ", createDate=" + getCreateDate() +
                ", remark='" + remark + '\'' +
                '}';
    }
}
